package PHANVANVUONG.ARRAY.DEMO;

public class SAMPLE01 {
	public static void main(String[] args) {
		double[] myDouble;
		
		myDouble=new double[10];
		myDouble[0]=6.5;
		myDouble[1]=7.5;
		myDouble[2]=8.5;
		myDouble[3]=9.5;
		
		
		/*System.out.println("myDouble[0]= "+myDouble[0]);
		System.out.println("myDouble[1]= "+myDouble[1]);
		System.out.println("myDouble[2]= "+myDouble[2]);
		System.out.println("myDouble[3]= "+myDouble[3]);*/
		
		for(int i=0; i<myDouble.length; i++){
			System.out.println("myDouble["+i+"]= "+myDouble[i]);
		}
		
		
		//sử dụng foreach
		double total=0;
		for(double value:myDouble){
			
			System.out.println("value= "+value);
			total += value;
		}
		
		System.out.println("Total = "+total);
	}
}
